//
//  SISSLoginNetworkingManager+Message.m
//  SISSAPP
//
//  Created by 优房网 on 2017/6/8.
//  Copyright © 2017年 优房网. All rights reserved.
//

#import "SISSLoginNetworkingManager+Message.h"

@implementation SISSLoginNetworkingManager (Message)

// 5.2.1 获取用户信息
- (void)requestIMContactListWithParameters:(id)parameters success:(void (^)(NSArray<SISSContactModel *> *))successBlock failed:(void (^)(NSError *))failedBlock {
    
    [SISSPublicSingleton shared].isHud = YES;
    [kLoginNetworkingManager POSTWithURLString:URL_IM_CONTACT_LIST parameters:parameters success:^(id responseObject) {
        
        NSLog(@"5.2.1 获取用户信息: responseObject-->%@",responseObject);
        if ([responseObject[@"result"] integerValue] != 200) {
            
            NSLog(@"%@",responseObject[@"data"]);
            return;
        }
        
        NSArray *dataArr = responseObject[@"data"];
        
        NSArray *contactArr = [NSArray yy_modelArrayWithClass:[SISSContactModel class] json:dataArr];
        
        if (successBlock) {
            successBlock(contactArr);
        }

        
    } faile:^(NSError *error) {
        
        if (failedBlock) {
            failedBlock(error);
        }
    }];
}



@end
